package com.sgcc.pda.bluetooth.config;

/**
 * 描 述：常量配置类
 * 作 者：yangzhi
 * 时 间：2020/3/5 16:56
 * 版 本：1.0
 * 版 权： Copyright (c) remarkables-united.Co.Ltd. All rights reserved.
 */
public class Constant {

    public static final int BLUE_CLS = 1;//经典蓝牙
    public static final int BLUE_BLE = 2;//ble
    public static final int RS485 = 3;//485
    public static final int RS232 = 4;//232
    public static final String SHARED_PREFERENCE_NAME = "com_sgcc_pda_task_preferenc";
    /**
     * 经典蓝牙目标远程设备串口通讯的UUID
     * 00001101-0000-1000-8000-00805F9B34FB
     */
    public static final String UUID_CLASSIC_COM = "00001101-0000-1000-8000-00805F9B34FB";
    /**
     * 低功耗service UUID
     */
    public static final String UUID_LE_SERVICE = "0000FFF0-0000-1000-8000-00805F9B34FB";
    /**
     * 低功耗characteristic UUID
     */
    public static final String UUID_LE_CHARACTERISTIC = "0000FFF1-0000-1000-8000-00805F9B34FB";
    public static final String UUID_CHAR_WRITE = "0000FFF2-0000-1000-8000-00805F9B34FB";
    /**
     * 低功耗客户端descriptor UUID
     */
    public static final String UUID_LE_DESCRIPTOR_CLIENT = "00002902-0000-1000-8000-00805F9B34FB";

    /**
     * 打开蓝牙请求码
     */
    public static final int REQUEST_ENABLE_BT = 1;
    /**
     * 区分发送、接收
     */
    public static final int TYPE_SEND = 0;//发送
    public static final int TYPE_RECEIVE = 1;//接收

    /**
     * 操作结果 0成功 -1失败
     */
    public static final int RESULT_SUCC = 0;//成功
    public static final int RESULT_FAIL = -1;//失败
    public static final int RESULT_OUTTIME = -2;//超时

    /**
     * 经典蓝牙连接超时标志
     */
    public static final int CONNECT_FAILURE = 0x02;

    /**
     * 经典蓝牙自动重连周期,断开连接后每隔多久进行一次连接
     */
    public static final int FLAG_RECONN = 0X03;
    public static final long TIME_RECONN = 10000;

    /**
     * 蓝牙自动重连超时时间
     */
    public static final long CLS_AUTO_CONN_TIME = 5000;
    /**
     * 蓝牙超时时间
     */
    public static final long CLS_CONN_OUT_TIME = 40 * 1000;

    /**
     * 蓝牙自动重连次数
     */
    public static final int RE_CONN_COUNT = 10;
    /**
     * 蓝牙超时时间
     */
    public static final int OVERTIME = 5000;
    /**
     * 蓝牙扫描超时时间
     */
    public static final long SCAN_OVER_TIME = 10000;


    /**
     * 蓝牙连接状态
     */
    public static final int CONNECTED = 1;//已连接
    public static final int DISCONNECTED = 2;//未连接

    /**
     * 蓝牙列表高度
     */
    public static final int BLUE_VIEW_HEIGHT = 1200;

    /**
     * 经典蓝牙通过message传递的key
     */
    public static final String MESSAGE_CLS_KEY = "clsKey";
    public static final String MESSAGE_BLE_KEY = "bleKey";

    /**
     * ble自动检测蓝牙可用状态
     */
    public static final int FLAG_CHECKBLUE = 0x04;

}
